<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/cropper.css">
    <link rel="stylesheet" href="/css/headMain.css">
    <style type="text/css">
        body{
            background-color: transparent;
        }
        -webkit-scrollbar{
            width: 2px;
            background: none;
        }
    </style>
</head>
<body>
<!-- Content -->
<div class="container" style="margin-top:50px;">
    <div class="row">
        <div class="col-5">
            <!-- <h3>Demo:</h3> -->
            <div class="img-container">
                <img id="image" th:src="${session.user.getHeadUrl()}" alt="Picture">
            </div>
        </div>
        <div class="col-5">
            <!-- <h3>Preview:</h3> -->
            <div class="docs-preview clearfix">
                <div class="img-preview preview-lg"></div>
            </div>
            <br/>
            <h5>修改指南</h5>
            <p>点击上传图片选择图片，最后点击上传头像完成修改！</p>
        </div>
    </div>
    <div class="row">
        <div class="col-md-9 docs-buttons">
            <!-- <h3>Toolbar:</h3> -->

            <div class="btn-group">
                <button type="button" class="btn btn-primary" data-method="zoom" data-option="0.1" title="Zoom In">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;zoom&quot;, 0.1)">
              放大
            </span>
                </button>
                <button type="button" class="btn btn-primary" data-method="zoom" data-option="-0.1" title="Zoom Out">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;zoom&quot;, -0.1)">
              缩小
            </span>
                </button>
            </div>

            <div class="btn-group">
                <button type="button" class="btn btn-primary" data-method="move" data-option="-10"
                        data-second-option="0" title="Move Left">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;move&quot;, -10, 0)">
              左移
            </span>
                </button>
                <button type="button" class="btn btn-primary" data-method="move" data-option="10" data-second-option="0"
                        title="Move Right">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;move&quot;, 10, 0)">
              右移
            </span>
                </button>
                <button type="button" class="btn btn-primary" data-method="move" data-option="0"
                        data-second-option="-10" title="Move Up">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;move&quot;, 0, -10)">
              上移
            </span>
                </button>
                <button type="button" class="btn btn-primary" data-method="move" data-option="0" data-second-option="10"
                        title="Move Down">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;move&quot;, 0, 10)">
              下移
            </span>
                </button>
            </div>

            <div class="btn-group">
                <button type="button" class="btn btn-primary" data-method="rotate" data-option="-90"
                        title="Rotate Left">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;rotate&quot;, -90)">
              左转90º
            </span>
                </button>
                <button type="button" class="btn btn-primary" data-method="rotate" data-option="90"
                        title="Rotate Right">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;rotate&quot;, 90)">
              右转90º
            </span>
                </button>
            </div>

            <div class="btn-group">
                <button type="button" class="btn btn-primary" data-method="reset" title="Reset">
            <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                  title="$().cropper(&quot;reset&quot;)">
              刷新
            </span>
                </button>
                <label class="btn btn-primary btn-upload" for="inputImage" title="Upload image file">
                    <input type="file" class="sr-only" id="inputImage" name="file"
                           accept=".jpg,.jpeg,.png,.gif,.bmp,.tiff">
                    <span class="docs-tooltip" data-toggle="tooltip" data-animation="false"
                          title="Import image with Blob URLs">
              选择头像
            </span>
                </label>
            </div>

            <div class="btn-group btn-group-crop">
                <button class="btn btn-primary" data-method="getCroppedCanvas"
                        data-option="{ &quot;width&quot;: 180, &quot;height&quot;: 90 }" type="button">
                    上传头像
                </button>
            </div>

            <!-- Show the cropped image in modal -->
            <div class="modal fade docs-cropped" id="getCroppedCanvasModal" aria-hidden="true"
                 aria-labelledby="getCroppedCanvasTitle" role="dialog" tabindex="-1">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="getCroppedCanvasTitle">Cropped</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body"></div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                            <a class="btn btn-primary" id="download" href="javascript:void(0);" download="cropped.jpg">Download</a>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>
<!-- Scripts -->
<script src="/js/jquery-3.4.1.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/tether.min.js"></script>
<script src="/bootstrap/js/bootstrap.min.js"></script>
<script src="/js/cropper.js"></script>
<script src="/js/headMain.js"></script>
</body>
</html>
